"""
遍历
遍历的三种方式适不适合字符串?
"""
from audioop import reverse

# s="aawhjfjwejcfzh131张"
# for a in s:
#     print(a)
#
# for index in range(len(s)):
#     print(s[index])
#
# for i, e in enumerate(s):
#     print(e)

a=['刘备', '诸葛亮', '曹操', '周瑜', '关羽']
a.reverse()         #对数据进行反转 返回的是一个迭代器，我们的容器是迭代器的一种
# 把列表中个成员名字逆序
for index in range(len(a)):
    a[index]="".join(reversed(a[index]))
    # a[index]=a[index][::-1]
print(a)

# s=["12"]
# s.reverse()
# for index in range(len(s)):
#     s[index]=s[index][::-1]
#     # s[index]="".join(reversed(s[index]))
# print(s)
